﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _2_6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            int startYear = int.Parse(textBox1.Text);
            int endYear = int.Parse(textBox2.Text);
          
            string leapYears = "";
            int count = 0;
           
            for (int year = startYear; year <= endYear; year++)
            {
                if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
                {
                    leapYears += year + "  ";
                    count++;
                   
                    if (count % 5 == 0)
                    {
                        leapYears += "\r\n";
                    }
                }
            }
           
            textBox3.Text = leapYears;
        }
    }
}